﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class NetworkManager : MonoBehaviour {
	public List<GameObject> PlayerList;
	public List<GameObject> InstPos;
	public static int PlayerNum = 10;	//最大玩家数目
	public static GameObject selfPlayer;

	// Use this for initialization
	void Start () {
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void OnConnectedToServer(){
		print ("conected");
		InstPlayer (0);
	}
	//当从服务器上断开连接
	void OnDisconnectedFromServer(){
	}

	public void InstPlayer(int playerID){
		selfPlayer = Network.Instantiate (PlayerList [playerID], InstPos [playerID].transform.position, 
			PlayerList [playerID].transform.rotation, 0) as GameObject;
	}
}
